<?php
/* @var $this InstrumentController */

$this->breadcrumbs=array(
	'大型仪器共享系统'=>array('instrument'),
    '预定信息查询',
);
?>
<?php
$this->menuitemName = '大型仪器共享系统';
$this->menuList = array();
$this->menuList[] = array('label'=>'返回仪器共享系统', 
    'url'=>'instrument/index'
);
?>
<div class="panel panel-box" style="overflow:hidden;">
    <div class="panel-heading">
    <div class="titleimage">
        <h3 class="panel-title panel-title-font">
            <?php echo '预定信息查询'; ?>
        </h3>
    </div>
    </div>
    <div class="panel-body" style="padding:25px" id="frontdatetable">
<h4>未过期预约</h4>
<?php $this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'instrument-reserve-grid',
    'dataProvider'=>$model->searchMyRecordPend(),
    'enableSorting'=>false,
    'columns'=>array(
	array(
		'name'=>'reserve_id',
		'value'=>'$data->reserve_id',
        ),
        array(
		'name'=>'instrument_id',
		'value'=>'$data->instrument->title',
        ),
        'instrumentElem.asset_number',
        'user.user_name',
        array(
            'name'=>'start_date',
            'value'=>'$data->getFormatTime()',
        ),
        array(
            'name'=>'place',
            'value'=>'$data->instrumentElem->instrument->place',
        ),
        array(
            'name'=>'status',
            'value'=>'$data->getStatusText()',
        ),
        array(
            'class'=>'CButtonColumn',
            'template'=>'{delete}',
            'buttons'=>array(
                'delete'=>array(
                    'visible'=>'$data->status =='.InstrumentReserve::STATUS_PASS_EXAMINE,
                    'url'=>'Yii::app()->createURL("instrument/deleteReserve", array("id"=>"$data->reserve_id"))',
                ),
            ),
            'header'=>'操作',
        ),
    ),
)); ?>

<h4>已过期预约</h4>
<?php $this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'instrument-reserve-grid',
    'dataProvider'=>$model->searchMyRecordPass(),
    'enableSorting'=>false,
    'columns'=>array(
        'reserve_id',
        array(
			'name'=>'instrument_id',
            'value'=>'$data->instrument->title',
        ),
        'instrumentElem.asset_number',
        'user.user_name',
        array(
            'name'=>'start_date',
            'value'=>'$data->getFormatTime()',
        ),
        array(
            'name'=>'place',
            'value'=>'$data->instrumentElem->instrument->place',
        ),
         array(
            'name'=>'status',
            'value'=>'$data->getStatusText()',
        ),
 
    ),
)); ?>


    </div>
</div>

